from pyrogram import filters
from pyrogram.types.messages_and_media import Message

from app import app


TARGET = -1001833464786


@app.on_message(filters.me & filters.command("hs"))
async def recycle(client, message: Message):
    from app.libs.recycleMagicCard import f

    try:
        id = int(message.command[1])
        turns = int(message.command[2])
    except:
        return await message.reply(f"参数错误`/recycle id turns`")
    await message.edit(f"```\n开始自动回收```")
    await f(id, turns)
    if id == 1:
        await message.edit(
            f"\n回收完成\n改名卡**{turns}**张，单价24w，回收金额 **{(24*turns)}** 万"
        )
    elif id == 2:
        await message.edit(
            f"\n回收完成\n神佑vip卡**{turns}**张，单价8w，回收金额 **{(8*turns)}** 万"
        )
    elif id == 3:
        await message.edit(
            f"\n回收完成\n邀请卡**{turns}**张，单价6.4w，回收金额 **{(6.4*turns):.2f}** 万"
        )
    elif id == 4:
        await message.edit(
            f"\n回收完成\n自动释放7天卡**{turns}**张，单价2.4w，回收金额 **{(2.4*turns):.2f}** 万"
        )
    else:
        await message.edit(f"\n回收完成\n无效回收，请输入id范围1-4 次数")
